#ifndef MCS_H
#define MCS_H

#include "IStreamLoadableWritable.h"
#include "McsHead.h"
#include "McsFrame.h"
#include <QList>

class Mcs : IStreamLoadableWritable
{
public:
    Mcs() = default;
    ~Mcs();

public:
	inline QList<McsFrame*>& GetFrames() { return frames; };
    inline const McsHead& GetMcsHead() const { return mcsHead; }
	inline void SetMcsHead(const McsHead& mcsHead_)
	{
	    this -> mcsHead = mcsHead_;
	    for(McsFrame* fp : frames)
	        delete fp;
        for(int i = 0; i < mcsHead.GetFrameCount(); ++i)
            frames.append(new McsFrame());
	}

public:
	bool TryLoad(std::istream& i) final;
	bool TryDump(std::ostream& o) final;
	bool IsDumpable() final;

private:
	McsHead mcsHead;
    QList<McsFrame*> frames;
};

#endif //MCS_H
